<!DOCTYPE HTML>
<html>
<head>
  <title>商品关联部落</title>
  <link rel="stylesheet" href="/stylesheets/style.css">
  <script src="/scripts/jquery.min.js"></script>
  <script src="/scripts/boot.js" type="text/javascript"></script>
  <link rel="stylesheet" href="/scripts/miniui/themes/default/miniui.css">
  <link rel="stylesheet" href="/scripts/miniui/themes/icons.css">
  <link rel="stylesheet" href="/scripts/miniui/themes/bootstrap/skin.css">
  <link rel="stylesheet" href="/editor/common.css">
  <script src="/scripts/miniui/miniui.js"></script>
</head>
<body  style="padding: 0;width: 99%;height: 92%">
<div style="width:100%;height:100%;">
  <div showCollapseButton="true" style="width: 100%;height: 100%">

    <div style="width:99%;">
      <div class="mini-toolbar" style="border-bottom:0;padding:0px;">
        <table style="width:100%;">
          <tr>
            <td style="width:100%;">
              <a class="mini-button" iconCls="icon-add" onclick="goodsTribeCorrelationAdd()">添加</a>
              <a class="mini-button" iconCls="icon-edit" onclick="goodsTribeCorrelationDel()">删除</a>
            </td>
          </tr>
        </table>
      </div>
    </div>

    <div id="datagrid1" class="mini-datagrid" style="width:99%;height: 100%;"
         url="/getdata/getGoodsTribeCorrelation" idField="id" allowResize="true"
         sizeList="[20,30,50,100]" pageSize="20"
    >
      <div property="columns">
        <div type="checkcolumn" width="15"></div>
        <div field="objectId" width="60" align="center" align="center" headerAlign="center">objectId</div>
        <div field="shopGoodsOId" width="80" align="center" align="center" headerAlign="center">商品ID</div>
        <div field="goodsName" width="80" align="center" align="center" headerAlign="center">商品名称</div>
        <div field="tribeOid" width="80" align="center" align="center" headerAlign="center">部落ID</div>
        <div field="tribeName" width="80" align="center" align="center" headerAlign="center">部落名称</div>
        <div field="createdAt" width="80" align="center" headerAlign="center">创建日期</div>
      </div>
    </div>
  </div>

</div>
</body>
<script type="text/javascript">
  var objectId;
  mini.parse();
  var grid = mini.get("datagrid1");
  grid.load();
  function goodsTribeCorrelationAdd() {
    mini.open({
      url: "/editor/goodsTribeCorrelationAdd/",
      title: "添加商品部落管理", width: 300, height: 200,
      ondestroy: function (action) {
        grid.reload();
      }
    });
  }
  function goodsTribeCorrelationDel() {

  }
  function goodsTribeCorrelationDel() {
    var currentRow = grid.getSelected();
    if (currentRow) {
      $.ajax({
        type: "POST",
        url: "/getdata/goodsTribeCorrelationDel",
        data: {
          objectId: currentRow.objectId,
        },
        success: function (result) {
          grid.reload();
        },
        fail: function (error) {
          console.log(error)
        }
      })
//      mini.open({
//        url: "/getdata/integralRatioEdit?objectId=" + currentRow.objectId,
//        title: "编辑用户属性", width: 300, height: 200,
//        ondestroy: function (action) {
//          grid2.reload();
//        }
//      });
    } else {
      alert("请选中一条信息!");
      return;
    };
  };



</script>
</html>
